//
//  ARSCNView+HKRuler.h
//  HKOCRuler
//
//  Created by lbxia on 2018/11/23.
//  Copyright © 2018年 lbx. All rights reserved.
//

#import <ARKit/ARKit.h>
#import "Utilities.h"

API_AVAILABLE(ios(11.0))
@interface HitTestRay : NSObject
@property (nonatomic, assign) SCNVector3 origin;
@property (nonatomic, assign) SCNVector3 direction;
@end


API_AVAILABLE(ios(11.0))
@interface FeatureHitTestResult : NSObject
@property (nonatomic, assign) SCNVector3 position;
@property (nonatomic, assign) CGFloat distanceToRayOrigin;
@property (nonatomic, assign) SCNVector3 featureHit;
@property (nonatomic, assign) CGFloat featureDistanceToHitResult;
@end


API_AVAILABLE(ios(11.0))
@interface ARSCNView (HKRuler)

- (HitTestRay*)hitTestRayFromScreenPos:(CGPoint)point;

- (SCNVector3OBJ*)hitTestWithInfiniteHorizontalPlane:(CGPoint)point pointOnPlane:(SCNVector3)pointOnPlane;

- (NSArray<FeatureHitTestResult*>*)hitTestWithFeatures:(CGPoint)point
                             coneOpeningAngleInDegrees:(CGFloat)coneOpeningAngleInDegrees
                                           minDistance:(CGFloat)minDistance
                                           maxDistance:(CGFloat)maxDistance
                                            maxResults:(int)maxResults;

- (NSArray<FeatureHitTestResult*>*)hitTestWithFeatures:(CGPoint)point;



- (NSArray<SCNVector3OBJ*>*) fliterWithFeatures:(NSArray<FeatureHitTestResult*>*) features;








@end
